Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

splitup ChainState type #1731

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

rukai
Copy link
Member

@rukai rukai commented Aug 21, 2024

This was an experiment to see if we could remove the confusing 'shorter/'longer lifetimes from the transform definition.
And I think it was a success!

Decoupling the transform iterator from the rest of ChainState gives us two design improvements:

  • ChainState no longer holds an internal reference making it much easier to work with.
  • We remove the reset method from the ChainState, reset is effectively a setup step that occurs after the constructor, which is something to be avoided.

One downside is that calling the call_next_transform method is now a little more convoluted as it takes an arg.
But I also think this makes it a little clearer what its actually doing.

I'll leave the PR as a draft for a while so I can think it over a bit.

@rukai rukai force-pushed the refactor-Wrapper branch 2 times, most recently from a840931 to a05054c Compare August 21, 2024 02:52
Copy link

codspeed-hq bot commented Aug 21, 2024

CodSpeed Performance Report

Merging #1731 will improve performances by 10.23%

Comparing rukai:refactor-Wrapper (42597ae) with main (837d5d6)

Summary

⚡ 1 improvements
✅ 38 untouched benchmarks

Benchmarks breakdown

Benchmark main rukai:refactor-Wrapper Change
encode_system.local_query_v4_lz4_compression 14.5 µs 13.2 µs +10.23%

@rukai rukai force-pushed the refactor-Wrapper branch 4 times, most recently from f93baab to 5542f51 Compare August 21, 2024 03:27
@rukai rukai changed the title refactor Wrapper type splitup ChainState type Aug 21, 2024
@rukai rukai force-pushed the refactor-Wrapper branch 2 times, most recently from ee44e20 to 117fce8 Compare August 22, 2024 03:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant